home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d11 / evnansi.arc / EVNANSI.DOC < prev    next >
Text File  |  1990-07-03  |  12KB  |  277 lines

  1. ;GL:11-29-88 -----------------------------------------------------------
  2. EVNANSI.SYS - Based on Daniel Kegel's NANSI.SYS
  3.  
  4. Gary Lorensen - Everex Systems, Inc.
  5.  
  6. I have modified the source code for this ANSI driver to provide support for
  7. the Everex EGA/VGA Extended Modes.  Beyond that I haven't added any 
  8. enhancements.  I assume that the code that I started with is pretty clean,
  9. but if you do find any problems, or find an update of Kegel's NANSI driver
  10. out there, please contact me here on the Everex BBS (415) 683-2924.
  11.  
  12. Remember when using ESCape sequences to change modes, that you should 
  13. exit from that mode using ESCape sequences also.  Otherwise, text may
  14. write off the bottom of the screen without scrolling, or stop writing
  15. half way up the screen.
  16.  
  17. There are some .TXT files for performing some of the special modes and
  18. functions.  Use the TYPE command to see there effects.  (After you have
  19. installed EVNANSI, of course).
  20.  
  21. If you wish to make additional changes to the NANSI driver, please document
  22. them for others.  If you want to find the changes I have made, search for
  23. the:
  24. ;GL:11-29-88 -----------------------------------------------------------
  25. ;GL:11-29-88 -----------------------------------------------------------
  26. lines (I love those little characters 30 and 31 (1Eh and 1Fh).
  27.  
  28. ;GL:11-29-88 -----------------------------------------------------------
  29.  
  30. Date:     Thu, 13 Feb 86 18:27:23 PST
  31. From:     kegel%Juliet.Caltech.Edu@Hamlet.Caltech.Edu
  32. Subject:  New ANSI driver, part 1 of 2
  33.  
  34.  
  35. Hi, folks.  Here's my console driver; the files are pretty long, and
  36. I apologize for simply stringing them together, but I'm not sure how
  37. else it could be sent.  This letter contains the documentation, the
  38. assembled driver (in hex, for loading with DEBUG), and some examples
  39. of how to set DOS RAW mode.  The following letter contains the five
  40. or so source files.  The source files are only needed if you want to
  41. make changes, or hunt down features or bugs.
  42.  
  43. [INFO-IBMPC distributes files in source form only. The HEX files have
  44. been deleted. -ed]
  45.  
  46. I admit, the source is pretty ugly some places; but it works well enough
  47. for my purposes.
  48.  
  49. So let me know what y'all think.
  50.  
  51.         - Daniel Kegel
  52. evnansi    - enhanced MS-DOS ansi console driver
  53.  
  54. SYNOPSIS
  55.     Include in \config.sys the line
  56.         device=evnansi.sys
  57.  
  58. DESCRIPTION
  59.     Evansi.sys is a console driver which understands ANSI control
  60.     sequences. It has several advantages over ANSI.SYS (the driver
  61.     supplied with DOS):
  62.     1. It supports new escape sequences (see below).
  63.     2. It provides MUCH faster output under certain conditions.
  64.     3. It supports the 43-line mode of the EGA.
  65.     4. The darned bell is now 1/4 second instead of 1/2 second long.
  66.  
  67.     What a console driver does:
  68.     When you, for example, type
  69.         C:> type foo.txt
  70.     COMMAND.COM opens the file foo.txt, reads it, and writes it to
  71.     the console driver, which puts it up on the screen.
  72.  
  73.     Both ansi.sys and evnansi.sys use IBM Video BIOS to control the screen.
  74.     However, evnansi.sys bypasses BIOS if the screen is in a text mode; this
  75.     allows much faster operation under certain conditions.
  76.  
  77.     While putting text up on the screen, (n)ansi.sys keeps a lookout for
  78.     the escape character (chr(27), known as ESC); this character signals
  79.     the start of a terminal control sequence.
  80.     Terminal control sequences follow the format
  81.         ESC [ param; param; ...; param cmd
  82.     where
  83.         ESC    is the escape character chr$(27).
  84.         [    is the left bracket character.
  85.         param    is an ASCII decimal number, or a string in quotes.
  86.         cmd    is a case-specific letter identifying the command.
  87.     Usually, zero, one, or two parameters are given.  If parameters
  88.     are omitted, they usually default to 1; however, some commands
  89.     (KKR and DKOCT) treat the no-parameter case specially.
  90.     Spaces are not allowed between parameters.
  91.  
  92.     For example, both ESC[1;1H and ESC[H send the cursor to the home
  93.     position (1,1), which is the upper left.
  94.  
  95.     Either single or double quotes may be used to quote a string.
  96.     Each character inside a quoted string is equivalent to one numeric
  97.     parameter.  Quoted strings are normally used only for the Keyboard
  98.     Key Reassignment command.
  99.  
  100. Control Sequences
  101.     The following table lists the sequences understood by evnansi.sys.
  102.     Differences between evnansi.sys and the standard ansi.sys are marked
  103.     with a vertical bar (|).
  104.  
  105. Cursor Positioning
  106. Short    Long name        Format        Notes
  107. CUP    cursor position        ESC[y;xH    Sets cursor position.
  108. HVP    cursor position        ESC[y;xf    Same as CUP; not recommended.
  109. CUU    cursor up        ESC[nA        n = # of lines to move
  110. CUD    cursor down        ESC[nB
  111. CUF    cursor forward        ESC[nC        n = # of columns to move
  112. CUB    cursor backward        ESC[nD
  113. DSR    Device Status, Report!    ESC[6n        Find out cursor position.
  114. CPR    Cursor Position report    ESC[y;xR    Response to DSR, as if typed.
  115. SCP    Save Cursor Position    ESC[s        Not nestable.
  116. RCP    Restore Cursor Position ESC[u
  117.  
  118. Editing
  119. ED    Erase in Display    ESC[2J    Clears screen.
  120. EL    Erase in Line        ESC[K    Clears to end of line.
  121. IL  |    Insert Lines        ESC[nL    Inserts n blank lines at cursor line.
  122. DL  |    Delete Lines        ESC[nM    Deletes n lines including cursor line.
  123. ICH |    Insert Characters    ESC[n@    Inserts n blank chars at cursor.
  124. DCH |    Delete Characters    ESC[nP    Deletes n chars including cursor char.
  125.  
  126.  
  127. Mode-Setting
  128. SGR    Set Graphics Rendition    ESC[n;n;...nm    See character attribute table.
  129. SM    Set Mode        ESC[=nh        See screen mode table.
  130. RM    Reset Mode        ESC[=nl        See screen mode table.
  131. IBMKKR    Keyboard Key Reass.    ESC["string"p
  132.     The first char of the string gives the key to redefine; the rest
  133.     of the string is the key's new value.
  134.     To specify unprintable chars, give the ASCII value of the char
  135.     outside of quotes, as a normal parameter.
  136.     IBM function keys are two byte strings; see the IBM Basic manual.
  137.     For instance, ESC[0;";dir a:";13;p redefines function key 1 to
  138.     have the value "dir a:" followed by the ENTER key.
  139.       | If no parameters given, all keys are reset to their default values.
  140.  
  141. DKOCT | Output char translate    ESC[n;ny
  142.       | When first char is encountered in output request, it is replaced with
  143.       | the second char.  This might be useful for previewing text before
  144.       | sending it to a printer with a funny print wheel.
  145.       | If no parameters are given, all chars are reset to normal.
  146.  
  147.  
  148. Character Attributes
  149.     The Set Graphics Rendition command is used to select foreground
  150.     and background colors or attributes.
  151.     When you use multiple parameters, they are executed in sequence, and
  152.     the effects are cumulative.
  153.        Attrib code        Value
  154.         0        All attributes off (normal white on black)
  155.         1        Bold
  156.         4        Underline
  157.         5        Blink
  158.         7        Reverse Video
  159.         8        Invisible (but why?)
  160.         30-37        foregnd blk/red/grn/yel/blu/magenta/cyan/white
  161.         40-47        background
  162.  
  163. Screen Modes
  164.     The IBM BIOS supports several video modes; the codes given in the
  165.     BIOS documentation are used as parameters to the Set Mode command.
  166.       | (In bitmap modes, the cursor is simulated with a small blob (^V).)
  167.         Mode Code        Value
  168.         0        text 40x25 Black & White
  169.         1        text 40x25 Color
  170.         2        text 80x25 Black & White
  171.         3        text 80x25 Color
  172.         4        bitmap 320x200 4 bits/pixel
  173.         5        bitmap 320x200 1 bit/pixel
  174.         6        bitmap 640x200 1 bit/pixel
  175.         7        (cursor wrap kludge)
  176.         13 (EGA)    bitmap 320x200 4 bits/pixel ?
  177.         14 (EGA)    bitmap 640x200 4 bits/pixel
  178.         16 (EGA)    bitmap 640x350 4 bits/pixel
  179. ;GL:11-29-88 -----------------------------------------------------------
  180.  In addition, I have added support for the following Everex Extd EGA/VGA
  181.  graphics and text modes.  Note that not all modes are available on
  182.  all adapter/monitor combinations.  Check your EGA/VGA adapter documentation
  183.  to see which modes you can use.
  184.  
  185.         128 (Everex)    640x480 16 color grfx
  186.         129 (Everex)    752x410 16 color grfx
  187.         130 (Everex)    800x600 16 color grfx
  188.         131 (Everex)    80x34 color text
  189.         132 (Everex)    80x60 color text
  190.         133 (Everex)    94x29 color text
  191.         134 (Everex)    94x51 color text
  192.         135 (Everex)    100x43 color text
  193.         136 (Everex)    100x75 color text
  194.         137 (Everex)    80x44 color text
  195.         138 (Everex)    132x25,8x14 color text
  196.         139 (Everex)    132x44,8x8 color text
  197.         140 (Everex)    132x25,8x8 color text
  198.         141 (Everex)    80x44 mono text
  199.         142 (Everex)    132x25,8x14 mono text
  200.         143 (Everex)    132x44,8x8 mono text
  201.         144 (Everex)    132x25,8x8 mono text
  202.         145 (Everex)    1280x350, 4 color grfx
  203.         146 (Everex)    1280x600, 4 color grfx
  204.         147 (Everex)    640x350, 256 color grfx
  205.         148 (Everex)    640x400, 256 color grfx
  206.         149 (Everex)    512x480, 256 color grfx
  207.         150 (Everex)    80x30 color text
  208.         151 (Everex)    94x25 color text
  209.         152 (Everex)    100x37 color text
  210.  
  211. Note that not all graphics modes are supported within the BIOS.  They must
  212. be supported through external drivers.
  213. ;GL:11-29-88 -----------------------------------------------------------
  214.     Mode 7 is an unfortunate kludge; Setting mode 7 tells the cursor
  215.     to wrap around to the next line when it passes the end of a line;
  216.     Resetting mode 7 tells the cursor to not wrap, but rather stay put.
  217.       | If your computer has the Enhanced Graphics Adaptor, modes between
  218.       | 8 and 15 are also supported; see the EGA BIOS for info.
  219.       | The EGA also lets you use a shorter character cell in text modes
  220.       | in order to squeeze 43 lines of text out of the 25-line text modes.
  221.       | To enter 43 line mode, set the desired 25-line text mode (0 to 3),
  222.       | then Set Mode 43.  For instance: ESC[=3h ESC[=43h.
  223.       | To exit 43 line mode, set the desired 25-line text mode again.
  224.       | Evansi.sys ignores mode 43 unless there is an EGA on your computer.
  225. ;GL:11-29-88 -----------------------------------------------------------
  226. I have patched the 43 function to also recognize the 80x50 mode of the VGA.
  227. When you request 43 line mode, it loads the 8x8 font, then looks to see
  228. what the new resolution is, rather than assuming it's 43
  229. (Yech! Assumptions...)
  230. ;GL:11-29-88 -----------------------------------------------------------
  231.  
  232. Faster Output
  233.       | Any program that sets the console to RAW mode, and buffers its
  234.       | output properly, can achieve extremely high screen update speeds in
  235.       | return for giving up the special functions of the keys ^C, ^S, and ^P.
  236.       | See IOCTL in the MS-DOS 3.x Technical Reference for more info.
  237.     Also, a small improvement in speed may be noticed with some
  238.     programs that use the DOS console in normal mode, as this driver
  239.     efficiently implements the (standard but undocumented) INT 29h
  240.     most-favored-device putchar used by DOS.
  241.  
  242. EXAMPLES
  243.     See the file setraw.doc for Macro Assembler, Lattice C,
  244.     and Microsoft C routines for entering and leaving raw mode.
  245.  
  246. BUGS
  247.     Insert and delete character do not work in graphics modes.
  248.     Graphics mode writing is slow.
  249.     The simulated cursor in graphics mode slows down single-char
  250.     writes by a factor of 3; it should be disable-able.
  251.     Does not support erase-to-end-of-screen and other useful functions.
  252.  
  253. Version
  254.     This version, 2.2, created February 1986.  Problems should
  255.     be reported to Daniel Kegel, 1-60 CIT, Pasadena, CA 91126
  256.     (or, after June 1986, 2648 169th Ave SE, Bellevue, Wa. 98008).
  257.     Your suggestions for improvement would be most welcome.
  258.  
  259. NOTE
  260.     This program may be distributed for educational and personal use
  261.     only.  Commercial use is verboten; get in touch with the author.
  262.  
  263. FILES
  264.     evnansi.doc    - this file
  265.     evnansi    - makefile- shows how to assemble & link
  266.     evnansi.sys    - device driver
  267.     evnansi.asm    - device driver guts
  268.     evnansid.asm    - definitions
  269.     evnansip.asm    - ANSI parameter grabber
  270.     evnansif.asm    - ANSI function handlers
  271.     evnansii.asm    - device driver init routine
  272.     setraw.cat    - concatenated examples
  273.         setraw.asm    - for assembly programs
  274.         setraw.msc    - for Microsoft C programs
  275.         setraw.lc    - for Lattice C programs
  276.         rawtest.lc    - example for Lattice C only
  277.